import axiosServer from '../utils/request'
/**
 * 登录接口 （验证码）
 * @param {*} phone 
 * @param {*} password 
 * @param {*} captcha 验证码可选选择后password参数将失效
 * @returns 
 */
export const RequestLogin = (phone,captcha)=>{
    return axiosServer({
        method:'get',
        url:'/login/cellphone',
        params:{
            phone,
            captcha
            // password,
        }
    })
}

/**
 * 登录接口 (密码)
 * @param {*} phone 
 * @param {*} password 
 * @param {*} captcha 验证码可选选择后password参数将失效
 * @returns 
 */
export const RequestPsLogin = (phone,password)=>{
    return axiosServer({
        method:'get',
        url:'/login/cellphone',
        params:{
            phone,
            password
        }
    })
}

/**
 * 发送验证码接口
 * @param {*} phone 
 * @returns 
 */
export const RequestCaptcha = (phone)=>{
    return axiosServer({
        method:'get',
        url:'/captcha/sent',
        params:{
            phone,
        }
    })
}


/**
 * 注册接口
 * @param {*} phone 
 * @returns 
 */
export const RequestRegister = (phone,password,nickname,captcha)=>{
    return axiosServer({
        method:'get',
        url:'/register/cellphone',
        params:{
            phone,
            password,
            nickname,
            captcha
        }
    })
}


/**
 * 获取用户信息1
 * @returns 
 */
 export const RequestUserStatus = ()=>{
    return axiosServer({
        method:'get',
        url:'/user/account',
        // url:'/login/status',
    })
}

/**
 * 获取用户信息2
 * @returns 
 */
 export const RequestUserStatus2 = ()=>{
    return axiosServer({
        method:'get',
        // url:'/user/account',
        url:'/login/status',
    })
}

/**
 * 退出登录
 * @returns 
 */
 export const RequestLogout = ()=>{
    return axiosServer({
        method:'get',
        url:'/logout',
    })
}

/**
 * 游客登录接口
 * @returns 
 */
 export const RequestAnonimous = ()=>{
    return axiosServer({
        method:'get',
        url:'/register/anonimous',
    })
}